<template>
  <div>
    <el-container>
      <el-aside :width="isCollapse?'64':'236'">
        <slider-menu :collapse="isCollapse" />
      </el-aside>

      <el-container>
        <el-header height="56px">
          <i class="iconfont" :class="isCollapse?'iconindent':'iconoutdent'" @click="toggleCollapse"></i>
          <Headr />
        </el-header>
        <tab></tab>
        <el-main id="main">

          <transition name="slide" mode="out-in">
            <router-view></router-view>
          </transition>

        </el-main>
        <!--<el-footer height="50px" v-html="this.CDATA.FOOTER_MSG"></el-footer>-->
      </el-container>
    </el-container>
  </div>
</template>

<script>
import SliderMenu from './SliderMenu';
import tab from '@/components/tab/tab';
import Headr from './Head';

export default {
  name: 'Base',
  components: {
    SliderMenu,
    Headr,
    tab
  },
  data() {
    return {
      isCollapse: false,
      drawerShow: false,
      direction: 'rtl',
    };
  },
  created() {
    this.tools.saveS('isCollapse', this.isCollapse);
  },
  destroyed() {
    this.tools.delS('isCollapse');
  },
  methods: {
    toggleCollapse() {
      this.isCollapse = !this.isCollapse;
      this.tools.saveS('isCollapse', this.isCollapse);
    },
  },
};
</script>

<style scoped lang="less">
  html, body {
    height: 100%;
  }

  /deep/ .el-select-dropdown {
    display: block;
  }

  .el-header, .el-footer {
    background-color: #f0f2f5;
    color: #333;
    text-align: center;
  }

  .el-header {
    background-color: #fff;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 1px 4px 0 rgba(0, 21, 41, 0.12);
    z-index: 98;
    height: 55px !important;
    line-height: 50px;

    i {
      font-size: 20px;
      cursor: pointer;
      color: rgba(0, 0, 0, 0.65);
    }
  }

  .el-aside {
    background-color: #001529;
    color: #333;
    text-align: center;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;

    /*滚动条整体样式*/
    &::-webkit-scrollbar{
      width: 0;/*竖向滚动条的宽度*/
      height: 0;/*横向滚动条的高度*/
    }

    &.small {
      width: 63px !important;

      .logo {
        display: none;
      }
    }

    .logo {
      width: 256px;
      height: 86px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 10px 0;

      a {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;

        img {
          display: block;
          width: 80%;
        }
      }
    }
  }

  .el-container {
    width: 100%;
    position: relative;
  }

  .el-main {
    /*margin-left: 256px;*/
    background-color: rgb(240, 242, 245);
    color: #333;
    height: 94vh;
    padding: 94px 0 0 0;

    > div {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
  }

  /deep/ .el-footer {
    line-height: 50px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);

    a {
      color: rgba(0, 0, 0, 0.45)
    }
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  /*.slide-enter-active, .slide-leave-active {*/
  /*  transition: all .5s ease-in-out;*/
  /*}*/

  /*.slide-enter, .slide-leave-to {*/
  /*  opacity: 0;*/
  /*  transform: translateX(3%);*/
  /*}*/

  .slide-enter-active {
    transition: all .5s ease-in-out;
  }

  .slide-enter {
    opacity: 0;
    transform: translateX(3%);
  }

  .show {
    display: block;
  }

  .hide {
    display: none;
  }
</style>
